package appapi.service.impl;

import appapi.Request.ApiReq.EquipApiReq;
import appapi.entity.Zhongjiao.EquipWarnEntity;
import appapi.service.TowerDataService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import appapi.entity.Zhongjiao.TowerDataEntity;
import appapi.dao.TowerDataMapper;

import java.util.List;

/**
 * @version: java version 1.8
 * @Author: Ygp Work
 * @description:
 * @date: 2023-08-09 16:17
 */

@Service
public class TowerDataServiceImpl implements TowerDataService {

    @Resource
    private TowerDataMapper towerDataMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return towerDataMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TowerDataEntity record) {
        return towerDataMapper.insert(record);
    }

    @Override
    public int insertSelective(TowerDataEntity record) {
        return towerDataMapper.insertSelective(record);
    }

    @Override
    public TowerDataEntity selectByPrimaryKey(Long id) {
        return towerDataMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TowerDataEntity record) {
        return towerDataMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TowerDataEntity record) {
        return towerDataMapper.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo<TowerDataEntity> selectPage(EquipApiReq req) {
        PageHelper.startPage(req.getCurrentPage(), req.getPageSize());
        List<TowerDataEntity> list = towerDataMapper.selectAll(req);

        return new PageInfo<>(list,req.getPageSize());
    }

}
